/**
 * Created by Administrator on 2017/6/23.
 */
//绑定事件
$('#ul').on('click','.img',function () {
    $(this).parent().parent().remove()
});
$('#ul').on('mouseover','.img',function () {
    $(this).attr('src','/admin/images/error2.png')
});
$('#ul').on('mouseout','.img',function () {
    $(this).attr('src','/admin/images/error1.png')
});
//添加管理员
$('#add').click(function () {
    var manage = $('#manage').val();
    $.ajax({
        type:'post',
        url:'/admin/area/exists',
        async:false,
        data:{
            "_token": $("input[name=_token]").val(),
            'manage':manage
        },
        dateType:'json',
        success:function(str) {
            var data = jQuery.parseJSON(str);
            if(data.status == '1'){
                $('#ul').append('<li><div class="a">&nbsp;<span class="mng">'+manage+'</span>&nbsp;<img src="/admin/images/error1.png" alt="" class="img">&nbsp;</div></li>')
            }else{
                return false;
            }
        }
    });
})